ERT

Syntax: ERT function
Location: HOTKEY II

The command ERT was introduced in the Hotkey System II to enable you to write programs which test the result of a function for an error code and report the error in one step.

Example:
100 PAPER 0:INK 7
110 CLS
120 AT 0,0:PRINT 'Enter an integer (0 to 300): ';
130 ERT GET_INT
140 PRINT 'The integer was : ';x
150 DEFine FuNction GET_INT
160  valid$='0123456789'
170  INPUT a$:IF a$='':RETurn -1
180  FOR i=1 TO LEN(a$):IF a$(i) INSTR valid$=0:RETurn -17
190  IF a$>300:RETurn -4
200  x=a$
210  RETurn x
220 END DEFine

CROSS-REFERENCE:
REPort will report an error without stopping the program.
